const express = require("express");
const router = express.Router();

const { createCaptchaService } = require("../services/captchaServices");

router.get("/", async function (req, res, next) {
  const captcha = await createCaptchaService();
  req.session.captcha = captcha.text;
  res.type("svg");
  res.send(captcha.data);
});

module.exports = router;
